package com.serie402.common.delegate;

import java.util.HashMap;
import java.util.Map;

import com.kiss.fw.delegate.AbstractDelegate;
import com.kiss.fw.exceptions.BusinessException;
import com.serie402.common.bo.PhotoAlbum;
import com.serie402.common.dto.GalleryDTO;
import com.serie402.common.dto.MusicDTO;
import com.serie402.common.dto.PhotoAlbumDTO;
import com.serie402.common.dto.VideoDTO;

public class MultimediaDelegate extends AbstractDelegate {
	public static Map<Integer, PhotoAlbum> albumCache = new HashMap<Integer, PhotoAlbum>(1000);
	
	public static class GalleryDelegate extends AbstractDelegate {
		public static class PhotoAlbumDelegate extends AbstractDelegate {
			private PhotoAlbumDelegate() {
			}
			
			public static void create(PhotoAlbumDTO _dto) throws BusinessException {
				executeCommand("CreatePhotoAlbum", _dto);
			}
			
			public static void read(PhotoAlbumDTO _dto) throws BusinessException {
				executeCommand("ReadPhotoAlbum", _dto);
			}
			
			public static void update(PhotoAlbumDTO _dto) throws BusinessException {
				executeCommand("UpdatePhotoAlbum", _dto);
			}
			
			public static void delete(PhotoAlbumDTO _dto) throws BusinessException {
				executeCommand("DeletePhotoAlbum", _dto);
			}
			
			public static void search(PhotoAlbumDTO _dto) throws BusinessException {
				executeCommand("SearchPhotoAlbums", _dto);
			}
		}
		
		private GalleryDelegate() {
		}
		
		public static void create(GalleryDTO _dto) throws BusinessException {
			executeCommand("CreateGallery", _dto);
		}
		
		public static void read(GalleryDTO _dto) throws BusinessException {
			executeCommand("ReadGallery", _dto);
		}
		
		public static void update(GalleryDTO _dto) throws BusinessException {
			executeCommand("UpdateGallery", _dto);
		}
		
		public static void delete(GalleryDTO _dto) throws BusinessException {
			executeCommand("DeleteGallery", _dto);
		}
		
		public static void search(GalleryDTO _dto) throws BusinessException {
			executeCommand("SearchGallery", _dto);
		}
	}
	
	public static class MusicDelegate extends AbstractDelegate {
		private MusicDelegate() {
		}
		
		public static void create(MusicDTO _dto) throws BusinessException {
			executeCommand("CreateMusic", _dto);
		}
		
		public static void read(MusicDTO _dto) throws BusinessException {
			executeCommand("ReadMusic", _dto);
		}
		
		public static void update(MusicDTO _dto) throws BusinessException {
			executeCommand("UpdateMusic", _dto);
		}
		
		public static void delete(MusicDTO _dto) throws BusinessException {
			executeCommand("DeleteMusic", _dto);
		}
		
		public static void search(MusicDTO _dto) throws BusinessException {
			executeCommand("SearchMusic", _dto);
		}
	}
	
	public static class VideoDelegate extends AbstractDelegate {
		private VideoDelegate() {
		}
		
		public static void create(VideoDTO _dto) throws BusinessException {
			executeCommand("CreateVideo", _dto);
		}
		
		public static void read(VideoDTO _dto) throws BusinessException {
			executeCommand("ReadVideo", _dto);
		}
		
		public static void update(VideoDTO _dto) throws BusinessException {
			executeCommand("UpdateVideo", _dto);
		}
		
		public static void delete(VideoDTO _dto) throws BusinessException {
			executeCommand("DeleteVideo", _dto);
		}
		
		public static void search(VideoDTO _dto) throws BusinessException {
			executeCommand("SearchVideo", _dto);
		}
	}
	
	private MultimediaDelegate() {
	}
}